-
Notifications
You must be signed in to change notification settings - Fork 0
Fix sync models #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sync models #59
Conversation
- Migrates user settings and preferences - Handles anonymous to authenticated user IDs - Uses in-memory data repositories - Includes error handling and logging - Implements idempotent migration logic
- Replaced Categories with Topics - Added logging to data clients - Updated data repositories - Migrated to new data models - Removed timeago locale messages
- Renamed `Category` to `Topic` for clarity. - Updated repository and provider usages. - Adjusted variable names accordingly. - Minor UI changes to reflect renaming. - Updated documentation references.
- Replaced `AppConfig` with `RemoteConfig` - Updated usage in `AppState` class
- Moved `demo_data_migration_service` - Updated `UserAppSettings` structure - Improved user role handling - Updated `AppConfig` to `RemoteConfig` - Refined user action tracking
- Added logging for better debugging. - Improved error handling for various cases. - Handle HtHttpException and other exceptions. - Provide more informative error messages. - Use OperationFailedException for consistency.
- Improved error logging. - Handle HtHttpException more gracefully. - Improved state management on errors. - Added better error messages. - Consolidated error handling logic.
- Moved `logging` import after `ht_shared` - Improved import order readability
- Added AppFontWeightChanged event. - Allows changing app font weight. - Updated bloc to handle new event. - Improved code documentation. - Added unit tests for new event.
- Added AppFontWeightChanged event - Updated AppBloc to handle new event - Added fontWeight to DisplaySettings - Updated state to include fontWeight - No persistent storage implemented yet
- Added `updateRequired` state. - Added `underMaintenance` state.
- Added AppOpened event. - Tracks app opening for updates/maintenance checks.
- Added AppOpened event handling. - Checks app status on opening. - Handles maintenance and version checks. - Emits appropriate AppStatus updates. - Improves app startup flow.
- Updated locale handling in App widget. - Consolidated localizations delegates. - Used AppLocalizations for strings. - Improved error handling in UI. - Improved Loading and Failure state widgets.
- Added AddTopicToFollowPage - Added FollowedTopicsListPage - Updated routing to include new pages - Implemented topic following/unfollowing - Improved UI/UX for topic management
- Renamed `followedCategories` variable to `followedTopics` for clarity. - Updated variable usage throughout the `AccountBloc` class.
- Added status enum (initial, loading, success, failure) - Added error handling - Implemented copyWith method - Updated Equatable props - Improved state management
- Added FetchAvailableTopics event - Updated AvailableTopicsEvent to abstract class
- Added bloc for fetching available topics - Implemented loading and error states - Uses HtDataRepository for data fetching - Handles HtHttpException and other errors - Improved error messages
- Replaced `SourcesFilterBloc` with `AvailableSourcesBloc` - Improved error handling and UI - Used `AppLocalizationsX` for localization - Updated widgets and styling - Simplified source display logic
- Renamed `AddCategoryToFollowPage` to `AddTopicToFollowPage` - Replaced categories with topics in UI and logic - Updated bloc and repository usage - Adapted strings and tooltips - Updated icons and placeholders
- Added translations for topic filter page - Included loading, error, and empty states - Added tooltips for follow/unfollow actions - Updated placeholders for better clarity - Improved overall user experience
- Added Arabic translations for topic filtering page. - Included loading, error, and empty states. - Added tooltips for follow/unfollow actions. - Updated placeholders for better clarity. - Improved overall user experience in Arabic.
- Added translations for topic filter page - Added strings for loading, error, and empty states - Included tooltips for follow/unfollow actions - Updated `AppLocalizations` abstract class - Added Arabic and English translations
- Renamed page and variables - Updated UI elements and icons - Replaced hardcoded strings with localization - Improved error handling and messages - Updated routing and navigation
- Added title for followed topics page. - Added tooltip for add topics button. - Added loading, error, and empty state strings.
- Replace shared constants and widgets imports with ht_shared and ht_ui_kit packages - Use AppLocalizationsX for localization - Update error handling in FailureStateWidget to use HtHttpException and UnknownException
- Add translations for light, regular, and bold font weight options in Arabic and English - Update arb files to include new font weight labels
…tings page - Replace app_spacing import with ht_ui_kit - Use AppLocalizationsX for localization
- Replace direct string usage with localized strings for font weights - Update import statements to use ht_ui_kit package - Use AppLocalizationsX extension for easier access to localizations
- Replace direct localization call with AppLocalizationsX wrapper - Update import statement to use ht_ui_kit package
- Replace constant import with ht_ui_kit package - Use AppLocalizationsX for localization
…lization - Remove import of AppSpacing - Add import of ht_ui_kit - Replace context.l10n with AppLocalizationsX(context).l10n for improved localization handling
- Replaced `EntityType` with `ContentType`. - Updated widget to use `headline.createdAt` and `headline.topic`. - Removed null check for `imageUrl` as it's now required. - Adjusted metadata display and navigation logic for topics.
- Replace EntityType with ContentType for better clarity - Remove unused imports and reorganize remaining imports - Simplify image loading and error handling for headline image - Remove unused l10n parameter and update localization import - Update routing and entity details handling - Replace broken timeago functionality with TODO comment
- Change 'entityType' to 'contentType' in EntityDetailsPageArguments - Update affected both topic and source navigation
- Replace custom image loading with Image.network - Remove unused imports and variables - Update category to topic terminology - Modify navigation to use EntityDetailsPageArguments - Remove time ago formatting for now
…y imports - Replace EntityType with ContentType for better consistency - Remove unnecessary imports and reorganize remaining ones - Simplify time ago formatting (TODO: replace with proper library) - Update category to topic terminology and related logic - Enhance source details navigation with ContentType specification
- Replace AccountAction with more generic FeedAction - Introduce support for multiple action types - Enhance user targeting and frequency control - Improve ad injection logic and naming - Update dependencies and class internals
…appConfig - Replace appConfig with remoteConfig in EntityDetailsBloc - Update method calls to use remoteConfig parameter - Throw exception if remoteConfig is not available
- Rename variable 'appConfig' to 'remoteConfig' in AppState class - Update related constructor and copyWith method parameters - Adjust comments to reflect the new variable name
- Renamed 'appConfig' to 'remoteConfig' for better reflection of its purpose - Updated variable name in multiple locations within the HeadlinesFeedBloc class
- Change 'appConfig' to 'remoteConfig' in _feedInjectorService.injectItems calls - This change improves code readability and consistency with parameter naming
- Replace null checks with isEmpty checks for description and callToActionText - Remove unused _getHintTextForModelType method - Update TODO comment about localization extension
- Change null check to isEmpty check for topic description - Ensure proper handling of empty strings in topic description
…tion - Change null check to empty string check for source description - Improve accuracy of displayed information in SourceItemWidget
- Removed unused import statement for 'package:ht_main/l10n/l10n.dart' - This change simplifies the code and removes unnecessary dependencies
- Removed unused import statement for 'package:ht_main/l10n/l10n.dart' - This change simplifies the code and reduces potential package dependencies
- Remove unused import statement for l10n package in headline_tile_text_only.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @fulleni, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces significant architectural improvements by refactoring core data models and standardizing state management across various features. It also integrates a new UI kit for a more consistent user experience and enhances data fetching mechanisms. The changes aim to improve the application's maintainability, scalability, and overall robustness.
Highlights
- Core Model Refactor & Rename: The
Category
model has been comprehensively replaced by a newTopic
model across the entire application, affecting data repositories, BLoCs, UI, and localization. Additionally, theAppConfig
model has been renamed toRemoteConfig
, andUserRole
toAppUserRole
for improved clarity and consistency. - Standardized Error Handling: Error handling has been significantly improved and standardized. All BLoCs now utilize
HtHttpException
objects for error reporting, replacing previous string-based error messages. Thelogging
package has been integrated to provide better debugging and error visibility. - UI Kit Integration: The application now leverages the
ht_ui_kit
library for common UI components. This change has led to the removal of several custom widgets and utility files (e.g.,app_spacing.dart
,FailureStateWidget
,LoadingStateWidget
), promoting a more consistent and maintainable user interface. - Enhanced Feed & Search Functionality: The
HeadlinesFeedBloc
andHeadlinesSearchBloc
have undergone major refactoring to align with the newTopic
model and standardized state management. Data fetching now uses a more flexiblefilter
andpagination
approach. TheFeedInjectorService
has been updated to support newFeedAction
types, replacing the olderAccountAction
. - Authentication State Management: The authentication BLoC has been refactored to use a single state class with an
AuthenticationStatus
enum, simplifying state transitions and improving predictability across the authentication flow.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is an excellent and extensive refactoring PR. The move to a unified state management pattern with a status enum and typed exceptions across the BLoCs (AccountBloc
, AuthenticationBloc
, HeadlinesFeedBloc
) significantly improves code clarity, maintainability, and robustness. The architectural decision to introduce a ht_ui_kit
and centralize shared components is also a great step forward.
The renaming of Category
to Topic
is applied consistently throughout the codebase.
Description
Type of Change